<?php

/**
 * Research form.
 *
 * @package    Redsea20
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ResearchForm extends BaseResearchForm {

    public function configure() {
        $this->useFields(array('title', 'citation', 'abstract', 'remarks', 'researchpaperurl', 
            'researchstatustyperefid', 'entityid'));

        $choices = array(
            Types::$RESEARCH_STATUS[Types::$RSTATUS_UNPUBLISHED] => ucwords(strtolower(Types::$RSTATUS_UNPUBLISHED)),
            Types::$RESEARCH_STATUS[Types::$RSTATUS_PUBLISHED] => ucwords(strtolower(Types::$RSTATUS_PUBLISHED)));
        
        $this->widgetSchema['title'] = new sfWidgetFormInputText();
        $this->widgetSchema['researchstatustyperefid'] = new sfWidgetFormChoice(array(
            'choices' => $choices
        ));

        $this->validatorSchema['abstract'] = new sfValidatorString(array('required' => false));
        $this->validatorSchema['citation'] = new sfValidatorString(array('required' => false));
        $this->validatorSchema['researchstatustyperefid'] = new sfValidatorChoice(array(
            'choices' => array_keys($choices)
        ));
    }

}

